﻿<UserControl x:Class="MoneyManagerNET.Presentation.View.SummaryOfAccountsReportView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="403" d:DesignWidth="440"
             
             
            xmlns:vm="clr-namespace:MoneyManagerNET.Presentation.ViewModel;assembly=MoneyManagerNET.Presentation.ViewModel" 
             
            d:DataContext="{x:Static Member=vm:DesignTimeViewModelSupplier.SummaryOfAccounts}">
	
    <Grid>
        <Grid.Resources>
            <DataTemplate DataType="{x:Type vm:AccountSummaryGroup}">
                <Border >
                    <StackPanel>
                        <ListBox ItemsSource="{Binding Path=Children}" IsHitTestVisible="False" BorderBrush="{x:Null}"  >

                        </ListBox>

                        <StackPanel Orientation="Horizontal" >
                            <Label Width="250" Content="{Binding Name}" FontSize="15" />
                            <Label Width="100" Content="{Binding Balance}" FontSize="15"/>
                        </StackPanel>
                        <Rectangle Fill="Black" Height="2"/>
                        <!--Height="{Binding Depth}"-->
                    </StackPanel>
                </Border>
            </DataTemplate>


            <DataTemplate  DataType="{x:Type vm:AccountSummary}">
                <Border >
                    <StackPanel>
                        <StackPanel Orientation="Horizontal">
                            <Label Width="250" Content="{Binding Name}" />
                            <Label Width="100" Content="{Binding Balance}"/>
                        </StackPanel>

                    </StackPanel>
                </Border>
            </DataTemplate>



            <!--<HierarchicalDataTemplate DataType    = "{x:Type vm:AccountSummaryGroup}"
                                ItemsSource = "{Binding Path=Children}">
                <TextBlock Text="{Binding Path=Name}"/>
            </HierarchicalDataTemplate>-->
        </Grid.Resources>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <Label Content="{Binding Path=UserName}" Name="label1" FontSize="20" />
        <Rectangle Margin="5" Fill="Silver" Height="2" Width="auto" VerticalAlignment="Bottom"/>
        <Label Grid.Row="1"  Content="Summary of accounts" FontSize="16"/>
        <Label Grid.Row="2" Content="{Binding Path=Today}" />

        <StackPanel Grid.Row="3">
            <StackPanel Orientation="Horizontal">
                <Label Background="Silver" Width="250" Content="Account Name" />
                <Label Background="Silver" Width="100" Content="Balance"/>
            </StackPanel>
            <ContentPresenter  Content="{Binding Path=RootGroup}" />
        </StackPanel>
    </Grid>
</UserControl>
